#!/bin/bash  
echo "the data have dealed,we will paint the pic"  
  
echo "
    set terminal png truecolor size 1920,480
    set output \"test.png\"  
      
    set ylabel \"sensor value\"          
    set xlabel  \"time(seconds)\"  
    set title \"Android sensor sample dat\"
	set xrange [0 : 10000]
	set yrange [-1.200 : 1.200]
	set mxtics 10
    plot \"$1\" using 1:2 with lines title \"x\"
" | gnuplot

    echo "the pic have done,named test.png"  
    exit 0  
